package com.lecture.java8.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;

/**
 * @author luyn
 * @description
 * @Date 2020/9/25 9:06
 * @Version 1.0
 */
public class DataListener<T> extends AnalysisEventListener<T> {

    List<T> dataList = new ArrayList<>();

    @Override
    public void invoke(T t, AnalysisContext analysisContext) {
        dataList.add(t);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    public List<T> getDataList() {
        return dataList;
    }
}
